1 | from mantidsimple import * |
---|
2 | |
---|
3 | PIX=1.1E-3 #m |
---|
4 | RunNo=4699 |
---|
5 | RIO=[69,80] |
---|
6 | DB=[26,31] |
---|
7 | Theta=0.49 |
---|
8 | SC=175 |
---|
9 | |
---|
10 | X=mtd['POLREF00004699'] |
---|
11 | ConvertUnits(InputWorkspace=X,OutputWorkspace=X,Target="Wavelength",AlignBins="1") |
---|
12 | CropWorkspace(InputWorkspace=X,OutputWorkspace='Io',XMin=0.8,XMax=14.5,StartWorkspaceIndex=2,EndWorkspaceIndex=2) |
---|
13 | CropWorkspace(InputWorkspace=X,OutputWorkspace='D',XMin=0.8,XMax=14.5,StartWorkspaceIndex=3) |
---|
14 | Io=mtd['Io'] |
---|
15 | D=mtd['D'] |
---|
16 | |
---|
17 | Divide(D,Io,'I','1','1') |
---|
18 | I=mtd['I'] |
---|
19 | |
---|
20 | ConvertSpectrumAxis(InputWorkspace=I,OutputWorkspace='tl1',Target='signed_theta') |
---|
21 | |
---|
22 | inst=I[0].getInstrument() |
---|
23 | sampleLocation=inst.getComponentByName('some-surface-holder').getPos() |
---|
24 | detLocation=inst.getComponentByName('pointdetector').getPos() |
---|
25 | sample2detector=detLocation-sampleLocation # meters |
---|
26 | |
---|
27 | # Move the detector so that the detector channel matching the reflected beam is at 0,0 |
---|
28 | MoveInstrumentComponent(Workspace=I,ComponentName="lineardetector",X=0,Y=0,Z=-PIX*(SC)) |
---|
29 | |
---|
30 | #CloneWorkspace(I,'I2') |
---|
31 | ConvertSpectrumAxis(InputWorkspace=I,OutputWorkspace='tl2',Target='signed_theta') |
---|
32 | |
---|
33 | ConvertUnits(InputWorkspace='tl2',OutputWorkspace='x_in_q',Target='MomentumTransfer',EMode='Indirect') |
---|